/// <reference types="@capacitor/cli" />
declare module '@capacitor/cli' {
  export interface PluginsConfig {
    TencentQQPlugin?: {
      appId: string;
    };
  }
}

export interface IsQQInstalledResult {
  installed: boolean;
}

export interface LoginOption {
  type: 'sso' | 'server-side' | null;
}

export interface LoginResult {
  ret: number;
  openid: string;
  access_token: string;
  pay_token: string;
  expires_in: number;
  pf: string;
  pfkey: string;
  msg: string;
  login_cost: number;
  query_authority_cost: number;
  authority_cost: number;
  expires_time: number;
}

export interface TencentQQPlugin {
  login(option: LoginOption): Promise<LoginResult | null>;
  isQQInstalled(): Promise<IsQQInstalledResult>;
}
